﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Net.Sockets;

namespace UniumLocalNetGames.Net
{
    class UniumLocalUdpSender
    {
        private UdpClient _client;
        public void SendMessage(UniumLocalMessage message)
        {
            _client = new UdpClient(15000);

            string final = UniumLocalMessages.InviteMessage;
            final += (int)message.type;
            final += message.text;
            byte[] bytes = ASCIIEncoding.ASCII.GetBytes(final);
            _client.Send(bytes, bytes.Length, message.sender);
        }
    }
}
